import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import Classify from '../views/Classify'
import Login from '../views/Login'
import Looked from '../views/Looked'
import Favorite from '../views/Looked/Favorite'
import History from '../views/Looked/History'
import My from '../views/My'
import Ranking from '../views/Ranking'
import Register from '../views/Register'
import Search from '../views/Search'
import SearchResult from '../views/SearchResult'
import Vip from '../views/Vip'
import City from '../views/City'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/classify',
      name: 'Classify',
      component: Classify
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/looked',
      name: 'Looked',
      component: Looked,
      children: [
        {
          path: 'favorite',
          name: 'Favorite',
          component: Favorite
        },
        {
          path: 'history',
          name: 'History',
          component: History
        },
        {
          path: '',
          redirect: '.looked/favorite'
        }
      ]
    },
    {
      path: '/my',
      name: 'My',
      component: My
    },
    {
      path: '/ranking',
      name: 'Ranking',
      component: Ranking
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/search-result',
      name: 'SearchResult',
      component: SearchResult
    },
    {
      path: '/vip',
      name: 'Vip',
      component: Vip
    },
    {
      path: '/city',
      name: 'City',
      component: City
    },
    {
      path: '/',
      redirect: '/home'
    }
  ]
})

export default router
